<jsp:include page="header.jsp" />
<jsp:include page="sidenav.jsp" />

<%@ page import="java.util.List" %>
<%@ page import="databean.ItemBean" %>

<div id ="content">
    <h1>Find Items By Keywords - Result</h1>
	<hr />	
	<br><label>Your searched keywords:</label> <font color=#FF0000><span class="right">${rq}</span></font>
	<br><label>Time requested: </label><font color=#FF0000><span class="right">${timestamp}</span></font>
	<br /><br/>
	<hr />
<br />
<% 
	List<ItemBean> beans = (List<ItemBean>) request.getAttribute("rs");
	boolean left = true;
	for(ItemBean bean:beans){
%>



<%
		if (left) {
%>



<div class ="result row1">

<p><label>Item ID: </label><span class="right"> <a href="<%=bean.getViewItemURL()%>" target=_blank><%=bean.getItemID()%></a></span></p>
<p><label>Title: </label><span class="right">  <%=bean.getTitle()%></span></p>
<p><label>Current Price: </label><span class="right">  <%=bean.getCurrentPrice()%></span></p>
<p><label>Category Name: </label><span class="right">  <%=bean.getCategoryName()%></span></p>
<p><label>Location: </label><span class="right">  <%=bean.getLocation()%></span></p>
<p><label>Start Time: </label><span class="right">  <%=bean.getStartTime()%></span></p>
<p><label>End Time: </label><span class="right">  <%=bean.getEndTime()%></span></p>



</div>


<%
	left = false;
		} else {
%>


<div class = "result row0">

<p><label>Item ID: </label><span class="right"> <a href="<%=bean.getViewItemURL()%>" target=_blank><%=bean.getItemID()%></a></span></p>
<p><label>Title: </label><span class="right">  <%=bean.getTitle()%></span></p>
<p><label>Current Price: </label><span class="right">  <%=bean.getCurrentPrice()%></span></p>
<p><label>Category Name: </label><span class="right">  <%=bean.getCategoryName()%></span></p>
<p><label>Location: </label><span class="right">  <%=bean.getLocation()%></span></p>
<p><label>Start Time: </label><span class="right">  <%=bean.getStartTime()%></span></p>
<p><label>End Time: </label><span class="right">  <%=bean.getEndTime()%></span></p>



</div>


<%
	left = true;
		}
%>

<%
}
%>
	
</div>
<jsp:include page="footer.jsp" />